package com.mask.thread.pk01;

/**
 * @author hx
 * @since 2021/12/2 1:55 下午
 */

public class Test2 {
    public static void main(String[] args) {
        String lock = new String();
        System.out.println("syn上面");

        synchronized (lock) {
            System.out.println("syn第一行代码");
            try {
                lock.wait();
                System.out.println("wait下面的代码");
            } catch (InterruptedException e) {
                e.printStackTrace();
            }
            System.out.println("syn下面的代码");
        }
    }
}
